package top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.service;

import top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.entity.AccessTokenEntity;
import top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.entity.RefreshTokenEntity;
import top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.valobj.AuthToken;
import top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.valobj.UserType;
import top.yaofengqiao.springcloudsimple.auth.biz.domain.security.model.UserInfo;

/**
 * @author yfq
 * @date 2024/6/6 16:22
 * @description
 */
public interface IOauthTokenService {
    /**
     * 创建AuthToken
     */
    AuthToken createAuthToken(UserInfo userInfo, UserType userType, String clientId);

    RefreshTokenEntity queryRefreshToken(String refreshToken);

    AccessTokenEntity queryAccessToken(String refreshToken);

    /**
     * 失效refreshToken
     *
     * @param refreshToken ...
     */
    void invalidedRefreshToken(String refreshToken);
}
